#pragma once

#include <iostream>
#include <string>

using namespace std;

template <class K> class __hash;


template <>
class __hash<string> {

    public:

        size_t operator()(const string theKey) const 
        {
            
            unsigned long hashValue = 0;
            const int len = static_cast<int>(theKey.length());
            for(int i = 0; i < len; i++) 
                hashValue = 5 * hashValue + theKey.at(i);

            return static_cast<size_t>(hashValue);
        }
};

template <> 
class __hash<int> {

    public:
        size_t operator()(const int theKey) const 
        {  return static_cast<size_t>(theKey); }
};

template <>
class __hash<long> {

    public:
        size_t operator()(const long theKey) const 
        { return static_cast<size_t>(theKey); }
};

